﻿<from class="layui-form layui-form-pane" action="" lay-filter="form-userall" id="form-userall">
    <input type="hidden" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label">账号</label>
        <div class="layui-input-block">
            <input type="text" name="account"  autocomplete="off" readonly
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">姓名</label>
        <div class="layui-input-block">
            <input type="text" name="name" autocomplete="off" readonly
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">最大项目数量</label>
        <div class="layui-input-block">
            <input type="text" name="maxProject" lay-verify="number" required autocomplete="off"
                   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item" style="text-align: center;">
        <button class="layui-btn" lay-submit="" lay-filter="form-userall">确认修改</button>
    </div>
</from>
<script type="text/javascript">

    layui.define(['layer', 'form'], function () {
        var form = layui.form;

        $.getJSON("../user/get/" + workUtils.get("id"), function (data) {
            workUtils.fillForm($("#form-userall"),data);
        });

        form.on('submit(form-userall)', function (data) {
            var index = layer.load(1);
            setTimeout(function () {
                workUtils.ajaxPost("../user/editmax",data.field,function (result) {
                    layer.close(index);
                    workUtils.msg(result);
                });
            }, 400);
            return false;
        });
    });
</script>